package com.tianma315.admin.stock.dao;

import com.baomidou.mybatisplus.plugins.Page;
import com.tianma315.admin.common.base.BaseDao;
import com.tianma315.admin.stock.domain.WarehousingRecord;
import com.tianma315.admin.stock.domain.vo.WarehousingRecordAndArrtVO;
import com.tianma315.admin.stock.domain.vo.WarehousingRecordVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

//                   _ooOoo_
//                  o8888888o
//                  88" . "88
//                  (| -_- |)
//                  O\  =  /O
//               ____/`---'\____
//             .'  \\|     |//  `.
//            /  \\|||  :  |||//  \
//           /  _||||| -:- |||||-  \
//           |   | \\\  -  /// |   |
//           | \_|  ''\---/''  |   |
//           \  .-\__  `-`  ___/-. /
//         ___`. .'  /--.--\  `. . __
//      ."" '<  `.___\_<|>_/___.'  >'"".
//     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//     \  \ `-.   \_ __\ /__ _/   .-` /  /
//======`-.____`-.___\_____/___.-`____.-'======
//                   `=---='
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//         佛祖保佑       永无BUG

/**
 * Description
 * <p>
 * Created by zcm on 2019/5/28.
 */
public interface WarehousingRecordDao extends BaseDao<WarehousingRecord> {

    List<WarehousingRecordVo> selectRecordPage(@Param("page") Page page, @Param("searchKey") String searchKey);

    List<WarehousingRecordAndArrtVO> statisticsProductTable(@Param("page")Page page,@Param("productId") List<Integer> productIds,
                                                            @Param("beginDate")Date beginDate, @Param("endDate")Date endDate);

    List<WarehousingRecordAndArrtVO> statisticsProductAllTable(@Param("productId") List<Integer> productIds,
                                                            @Param("beginDate")Date beginDate, @Param("endDate")Date endDate);

    List<WarehousingRecordAndArrtVO> statisticsProductPage(@Param("page")Page page,
                                                           @Param("productName") String productName,
                                                           @Param("beginDate")Date beginDate,
                                                           @Param("endDate")Date endDate);

    List<WarehousingRecordVo> selectRecordList(@Param("batch")String batch, @Param("productName")String productName);

    WarehousingRecordVo selectRecordById(@Param("warehousingRecordId")Integer warehousingRecordId);

    @Update("UPDATE warehousing_record SET img_url = #{imgUrl} WHERE warehousing_record_id = #{warehousingRecordId}")
    int updateWareById(WarehousingRecord warehousingRecord);
}
